#ifndef COL2_IM_CUSTOM_TILING_H
#define COL2_IM_CUSTOM_TILING_H

#include "register/tilingdata_base.h"

namespace optiling {
constexpr int32_t USE_CORE_NUM = 8; // default core count

// 数据类型标志位定义
enum DataTypeFlag {
    DT_UINT8  = 0,   // uint8类型
    DT_INT16  = 1,   // int16类型
    DT_INT32  = 2,   // int32类型
    DT_FLOAT16 = 3,  // half类型
    DT_FLOAT  = 4    // float类型
};
BEGIN_TILING_DATA_DEF(Col2ImCustomTilingData)
    // 基础维度参数
    TILING_DATA_FIELD_DEF(int32_t, N);
    TILING_DATA_FIELD_DEF(int32_t, C);
    TILING_DATA_FIELD_DEF(int32_t, H);
    TILING_DATA_FIELD_DEF(int32_t, W);
    
    // 卷积参数
    TILING_DATA_FIELD_DEF(int32_t, kernel_h);
    TILING_DATA_FIELD_DEF(int32_t, kernel_w);
    TILING_DATA_FIELD_DEF(int32_t, stride_val);
    TILING_DATA_FIELD_DEF(int32_t, padding_val);
    TILING_DATA_FIELD_DEF(int32_t, dilation_val);
    
    // 输入列格式维度
    TILING_DATA_FIELD_DEF(int32_t, input_channels); // C * kH * kW
    TILING_DATA_FIELD_DEF(int32_t, L); // out_H * out_W
    TILING_DATA_FIELD_DEF(int32_t, out_H);
    TILING_DATA_FIELD_DEF(int32_t, out_W);
    
    // 元素数量
    TILING_DATA_FIELD_DEF(uint64_t, input_elements);  // 输入col元素总数
    TILING_DATA_FIELD_DEF(uint64_t, output_elements); // 输出图像元素总数
    
    // 核间划分信息（按输出像素划分）
    TILING_DATA_FIELD_DEF(uint32_t, total_output_pixels); // N*C*H*W
    TILING_DATA_FIELD_DEF(int32_t, base_pixels_per_core);
    TILING_DATA_FIELD_DEF(int32_t, big_core_num);
    TILING_DATA_FIELD_DEF_ARR(int32_t, USE_CORE_NUM, core_pixel_start);
    TILING_DATA_FIELD_DEF_ARR(int32_t, USE_CORE_NUM, core_pixel_end);
    TILING_DATA_FIELD_DEF_ARR(int32_t, USE_CORE_NUM, core_pixel_count);
    
    // 核内划分信息
    TILING_DATA_FIELD_DEF(int32_t, tile_pixel_num);
    TILING_DATA_FIELD_DEF_ARR(int32_t, USE_CORE_NUM, core_loop_times);
    TILING_DATA_FIELD_DEF_ARR(int32_t, USE_CORE_NUM, core_tail_pixels);
    TILING_DATA_FIELD_DEF(int32_t, aligned_pixel_size);
END_TILING_DATA_DEF;

REGISTER_TILING_DATA_CLASS(Col2ImCustom, Col2ImCustomTilingData)
}
#endif // COL2_IM_CUSTOM_TILING_H